﻿using AnQinFrameWorkAPI.Entity.Develop.DTO.DevelopProjectCustomer;
using AnQinFrameWorkAPI.Entity.Develop.DTO.DevelopProjectDemand;
using AnQinFrameWorkAPI.Entity.Develop.DTO.DevelopProjectList;
using AnQinFrameWorkAPI.Entity.Develop.DTO.DevelopProjectSales;
using AnQinFrameWorkAPI.Entity.Develop.Entity;
using AnQinFrameWorkAPI.Entity.Develop.View.DevelopProjectCustomer;
using AnQinFrameWorkAPI.Entity.Develop.View.DevelopProjectDemand;
using AnQinFrameWorkAPI.Entity.Develop.View.DevelopProjectDevelopment;
using AnQinFrameWorkAPI.Entity.Develop.View.DevelopProjectImplement;
using AnQinFrameWorkAPI.Entity.Develop.View.DevelopProjectList;
using AnQinFrameWorkAPI.Entity.Develop.View.DevelopProjectSales;
using AutoMapper;

namespace AnQinFrameWorkAPI.Common.Mapper;

public class DevelopMapper : Profile
{
    public DevelopMapper()
    {
        //全局配置
        CreateMap<Guid?, string>().ConvertUsing(src =>
            src == null || src == Guid.Empty ? null : src.Value.ToString());

        #region 开发

        #region 客户管理

        CreateMap<DevelopProjectCustomerAddDTO, DevelopProjectCustomerModel>();
        CreateMap<DevelopProjectCustomerUpdateDTO, DevelopProjectCustomerModel>();
        CreateMap<DevelopProjectCustomerModel, DevelopProjectCustomerView>();

        #endregion

        #region 项目列表管理

        CreateMap<DevelopProjectListAddDTO, DevelopProjectListModel>();
        CreateMap<DevelopProjectListUpdateDTO, DevelopProjectListModel>();
        CreateMap<DevelopProjectListModel, DevelopProjectListView>();

        #endregion

        #region 项目需求管理

        CreateMap<DevelopProjectDemandAddDTO, DevelopProjectDemandModel>();
        CreateMap<DevelopProjectDemandUpdareDTO, DevelopProjectDemandModel>();
        CreateMap<DevelopProjectDemandModel, DevelopProjectDemandView>();
        CreateMap<DevelopProjectDemandModel, DevelopProjectDemandDevelopmentView>();
        CreateMap<DevelopProjectDemandModel, DevelopProjectDemandImplementView>();

        #endregion

        #region 项目流程管理

        CreateMap<DevelopProjectSalesAddDTO, DevelopProjectManagerModel>();
        CreateMap<DevelopProjectSalesUpdateDTO, DevelopProjectManagerModel>();
        CreateMap<DevelopProjectManagerModel, DevelopProjectSalesView>();
        CreateMap<DevelopProjectManagerModel, DevelopProjectDevelopmentView>();
        CreateMap<DevelopProjectManagerModel, DevelopProjectImplementView>();

        #endregion

        #endregion
    }
}